



#ifndef _PDF_FONT_MANAGER_H_
#define _PDF_FONT_MANAGER_H_

#include <wx/arrstr.h>
#include <wx/string.h>

#include "wx/pdfdocdef.h"
#include "wx/pdffont.h"

class WXDLLIMPEXP_FWD_PDFDOC wxPdfFontData;
class wxPdfFontManagerBase;

/// Class representing the font manager
class WXDLLIMPEXP_PDFDOC wxPdfFontManager
{
public:
  /// Get the font manager
  
  static wxPdfFontManager* GetFontManager();

  /// Add a path entry to the font search path list
  
  void AddSearchPath(const wxString& path);

  /// Add a list of path entries to the font search path list
  
  void AddSearchPath(const wxArrayString& pathArray);

  /// Set the default embedding mode
  
  bool SetDefaultEmbed(bool embed);

  /// Get the default embedding mode
  
  bool GetDefaultEmbed();

  /// Set the default subsetting mode
  
  bool SetDefaultSubset(bool subset);

  /// Get the default subsetting mode
  
  bool GetDefaultSubset();

  /// Register a font
  
  wxPdfFont RegisterFont(const wxString& fontFileName, const wxString& aliasName = wxEmptyString, int fontIndex = 0);

  /// Register a font basedon a wxFont object
  
  wxPdfFont RegisterFont(const wxFont& font, const wxString& aliasName = wxEmptyString);

  /// Register a font collection
  
  int RegisterFontCollection(const wxString& fontCollectionFileName);

  /// Register a CJK font family
  
  bool RegisterFontCJK(const wxString& family);

  /// Register the fonts known to the operating system
  
  int RegisterSystemFonts();

  /// Register all fonts located in a directory
  
  int RegisterFontDirectory(const wxString& directory, bool recursive = false);

  /// Get a font by name and style
  
  wxPdfFont GetFont(const wxString& fontName, int fontStyle = wxPDF_FONTSTYLE_REGULAR) const;

  /// Get a font by name and style
  
  wxPdfFont GetFont(const wxString& fontName, const wxString& fontStyle) const;

  /// Get a font by index
  
  wxPdfFont GetFont(size_t fontIndex) const;

  /// Get the number of registered fonts
  
  size_t GetFontCount() const;

  /// Initialize the font data of a font
  
  bool InitializeFontData(const wxPdfFont& font);

  /// Register a font encoding
  
  bool RegisterEncoding(const wxPdfEncoding& encoding);

  /// Get the encoding having the given name
  
  const wxPdfEncoding* GetEncoding(const wxString& encodingName);

private:
  /// Default constructor
  wxPdfFontManager();
  
  /// Default destructor
  ~wxPdfFontManager();

  /// Copy destructor
  wxPdfFontManager(const wxPdfFontManager&);

  /// Assignment operator
  wxPdfFontManager& operator=(const wxPdfFontManager&);
  
private:
  wxPdfFontManagerBase*    m_fontManagerBase; ///< Font manager implementation
  
  static wxPdfFontManager* ms_fontManager;    
  friend class wxPdfDocumentModule;
};

#endif
